import request from '@/utils/request'

// 查询关联方登记列表
export function listRiskRelatedParties(query) {
  return request({
    url: '/relatedParties/riskRelatedParties/list',
    method: 'get',
    params: query
  })
}

// 查询关联方登记详细
export function getRiskRelatedParties(id) {
  return request({
    url: '/relatedParties/riskRelatedParties/' + id,
    method: 'get'
  })
}

// 只获取主表的信息关联方登记详细
export function getRelatedParties(id) {
  return request({
    url: '/relatedParties/riskRelatedParties/getRelatedParties/' + id,
    method: 'get'
  })
}

// 保存关联方登记
export function saveRiskRelatedParties(data) {
  return request({
    url: '/relatedParties/riskRelatedParties/save',
    method: 'post',
    data: data
  })
}

// 删除关联方登记
export function delRiskRelatedParties(id) {
  return request({
    url: '/relatedParties/riskRelatedParties/' + id,
    method: 'delete'
  })
}

// 导出关联方登记
export function exportRiskRelatedParties(query) {
  return request({
    url: '/relatedParties/riskRelatedParties/export',
    method: 'get',
    params: query
  })
}

// 校验录入的员工是否重复
export function checkStaffName(query) {
  return request({
    url: '/relatedParties/riskRelatedParties/checkStaffName/',
    method: 'get',
    params: query
  })
    .then(result => result.code === 200 && result.data)
}
